/* Classic Markdown Style - 经典文档风格 */
/* 基于旧项目的_markdown.scss优化而来 */

/* 文本基础样式 */
.markdown-classic {
  font-size: 14px;
  color: #353535;
  word-spacing: 0.8px;
  letter-spacing: 0.8px;
  border-radius: 5px;
  line-height: 1.75;
}

.markdown-classic p {
  line-height: 1.75;
  margin: 7px 0;
}

.markdown-classic a {
  color: rgb(55, 53, 47);
  font-weight: 400;
  border-bottom: 0.05em solid;
  border-color: rgba(55, 53, 47, 0.4);
  opacity: 0.7;
  text-decoration: none;
  transition: all 0.2s ease;
}

.markdown-classic a:hover {
  opacity: 1;
  border-color: rgba(55, 53, 47, 0.8);
}

.markdown-classic strong {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 50%, #FFF3E0 50%, #FFF3E0 100%);
  padding: 0 2px;
  font-weight: 600;
}

.markdown-classic em {
  color: rgb(248, 57, 41);
  font-style: italic;
}

/* 标题样式 */
.markdown-classic h1 {
  font-size: 22px;
  font-weight: 300;
  padding: 3px 0 1px;
  margin: 20px 0 15px 0;
  color: #2c3e50;
}

.markdown-classic h2 {
  font-size: 16px;
  text-align: left;
  margin: 20px 10px 10px 0;
  font-weight: 700;
  padding-left: 10px;
  border-left: 5px solid rgb(248, 57, 41);
  color: #2c3e50;
}

.markdown-classic h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  color: #34495e;
}

.markdown-classic h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 14px 0 6px 0;
  color: #34495e;
}

.markdown-classic h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 4px 0;
  color: #34495e;
}

.markdown-classic h6 {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 4px 0;
  color: #34495e;
}

/* 列表样式 */
.markdown-classic ul {
  margin: 10px 0 10px 0;
  padding-left: 20px;
}

.markdown-classic ol {
  color: #f83929;
  font-size: 14px;
  margin: 10px 0 10px 0;
  padding-left: 25px;
}

.markdown-classic li::marker {
  color: #f83929;
  font-weight: 600;
}

.markdown-classic li {
  color: #353535;
  margin-top: 7px;
  margin-bottom: 7px;
  line-height: 1.75;
}

.markdown-classic li p {
  margin: 4px 0;
}

/* 引用文字 */
.markdown-classic blockquote {
  font-style: normal;
  border-left: none;
  padding: 15px 20px 25px;
  line-height: 1.75;
  border-radius: 13px;
  color: #353535;
  background: #f5f5f5;
  margin: 1em 0;
  position: relative;
}

.markdown-classic blockquote::before {
  content: "\201C";
  display: block;
  font-size: 2em;
  color: rgb(248, 57, 41);
  font-family: Arial, serif;
  line-height: 1em;
  font-weight: 700;
  margin-bottom: 5px;
}

.markdown-classic blockquote p {
  color: #353535;
  font-size: 14px;
  margin: 0 0 10px 0;
  display: block;
}

.markdown-classic blockquote::after {
  content: "\201D";
  position: absolute;
  bottom: 10px;
  right: 15px;
  font-size: 2em;
  color: rgb(248, 57, 41);
  font-family: Arial, serif;
  line-height: 1em;
  font-weight: 700;
}

/* 表格样式 */
.markdown-classic table {
  border-collapse: collapse;
  margin: 16px 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

.markdown-classic table tbody {
  display: table;
  width: 100%;
}

.markdown-classic table tr {
  display: table-row;
}

.markdown-classic table tr th,
.markdown-classic table tr td {
  font-size: 13px;
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: left;
  min-width: 85px;
  display: table-cell;
}

.markdown-classic table tr th {
  font-size: 14px;
  color: #353535;
  background-color: #dbd9d8;
  font-weight: 600;
}

/* 代码样式 */
.markdown-classic pre {
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(238, 238, 238, 0.7);
}

.markdown-classic pre code {
  display: block;
  font-family: 'SFMono-Regular', Menlo, Consolas, 'PT Mono', 'Liberation Mono', Courier, monospace;
  border-radius: 0;
  font-size: 12px;
  overflow-x: auto;
  padding: 16px;
  color: #383a42;
  background: transparent;
  line-height: 1.5;
}

/* 行内代码 */
.markdown-classic p code,
.markdown-classic li code,
.markdown-classic td code,
.markdown-classic th code {
  font-family: 'SFMono-Regular', Menlo, Consolas, 'PT Mono', 'Liberation Mono', Courier, monospace;
  line-height: normal;
  background: rgba(135, 131, 120, 0.15);
  color: #EB5757;
  border-radius: 4px;
  font-size: 85%;
  padding: 0.2em 0.4em;
  border: none;
}

/* 分隔线 */
.markdown-classic hr {
  height: 2px;
  padding: 0;
  border: none;
  text-align: center;
  background-image: linear-gradient(to right, rgba(248, 57, 41, 0), rgba(248, 57, 41, 0.75), rgba(248, 57, 41, 0));
  margin: 24px 0;
}

/* 图片样式 */
.markdown-classic img {
  border-radius: 8px;
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin: 16px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.markdown-classic figure {
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
  text-align: center;
}

.markdown-classic figure img {
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.markdown-classic figcaption {
  display: block;
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* 标签样式 */
.markdown-classic .tag,
.markdown-classic .m-tag2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  margin: 0 3px 3px 0;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
  border: 1px solid transparent;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.2s;
  color: #e6a23c;
  background-color: #fdf6ec;
  border-color: #faecd8;
}

/* 脚注样式 */
.markdown-classic .footnotes {
  font-size: 14px;
  margin-top: 32px;
  border-top: 2px solid #f83929;
  padding-top: 16px;
}

.markdown-classic .footnotes-sep::before {
  content: '参考资料';
  color: #f83929;
  letter-spacing: 1px;
  text-align: left;
  display: block;
  font-weight: 600;
  padding-bottom: 8px;
  font-size: 18px;
  margin-bottom: 16px;
}

.markdown-classic .footnote-word,
.markdown-classic .footnote-ref {
  font-weight: normal;
  color: #f83929;
  text-decoration: none;
}

.markdown-classic .footnote-word:hover,
.markdown-classic .footnote-ref:hover {
  text-decoration: underline;
}

.markdown-classic .footnote-num {
  color: #f83929;
  font-weight: 600;
}

.markdown-classic .footnote-item p {
  font-weight: 400;
  color: #f83929;
  margin: 8px 0;
}

.markdown-classic .footnote-item p em {
  font-weight: 400;
  font-size: 14px;
  color: #353535;
  font-style: italic;
}

/* 数学公式 */
.markdown-classic .block-equation,
.markdown-classic .inline-equation {
  color: #353535;
}

.markdown-classic .block-equation {
  text-align: center;
  margin: 16px 0;
}

/* 深色模式适配 */
.dark .markdown-classic {
  color: #e6e6e6;
}

.dark .markdown-classic p {
  color: #e6e6e6;
}

.dark .markdown-classic a {
  color: #8bb6ff;
  border-color: rgba(139, 182, 255, 0.4);
}

.dark .markdown-classic a:hover {
  border-color: rgba(139, 182, 255, 0.8);
}

.dark .markdown-classic strong {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 50%, rgba(255, 193, 7, 0.3) 50%, rgba(255, 193, 7, 0.3) 100%);
  color: #e6e6e6;
}

.dark .markdown-classic em {
  color: #ff6b6b;
}

.dark .markdown-classic h1,
.dark .markdown-classic h2,
.dark .markdown-classic h3,
.dark .markdown-classic h4,
.dark .markdown-classic h5,
.dark .markdown-classic h6 {
  color: #e6e6e6;
}

.dark .markdown-classic h2 {
  border-left-color: #ff6b6b;
}

.dark .markdown-classic li {
  color: #e6e6e6;
}

.dark .markdown-classic li::marker {
  color: #ff6b6b;
}

.dark .markdown-classic ol {
  color: #ff6b6b;
}

.dark .markdown-classic blockquote {
  background: #2d2d2d;
  color: #e6e6e6;
}

.dark .markdown-classic blockquote::before,
.dark .markdown-classic blockquote::after {
  color: #ff6b6b;
}

.dark .markdown-classic blockquote p {
  color: #e6e6e6;
}

.dark .markdown-classic table tr th {
  background-color: #3d3d3d;
  color: #e6e6e6;
  border-color: #555;
}

.dark .markdown-classic table tr td {
  border-color: #555;
  color: #e6e6e6;
}

.dark .markdown-classic pre {
  background-color: rgba(45, 45, 45, 0.8);
}

.dark .markdown-classic pre code {
  color: #e6e6e6;
}

.dark .markdown-classic p code,
.dark .markdown-classic li code,
.dark .markdown-classic td code,
.dark .markdown-classic th code {
  background: rgba(255, 255, 255, 0.1);
  color: #ffc107;
}

.dark .markdown-classic hr {
  background-image: linear-gradient(to right, rgba(255, 107, 107, 0), rgba(255, 107, 107, 0.75), rgba(255, 107, 107, 0));
}

.dark .markdown-classic figcaption {
  color: #b3b3b3;
}

.dark .markdown-classic .footnotes {
  border-top-color: #ff6b6b;
}

.dark .markdown-classic .footnotes-sep::before {
  color: #ff6b6b;
}

.dark .markdown-classic .footnote-word,
.dark .markdown-classic .footnote-ref,
.dark .markdown-classic .footnote-num {
  color: #ff6b6b;
}

.dark .markdown-classic .footnote-item p {
  color: #ff6b6b;
}

.dark .markdown-classic .footnote-item p em {
  color: #e6e6e6;
}

/* 移动端响应式 */
@media (max-width: 768px) {
  .markdown-classic {
    font-size: 16px;
  }

  .markdown-classic p {
    font-size: 16px;
  }

  .markdown-classic h1 {
    font-size: 26px;
  }

  .markdown-classic h2 {
    font-size: 18px;
  }

  .markdown-classic h3 {
    font-size: 18px;
  }

  .markdown-classic h4 {
    font-size: 17px;
  }

  .markdown-classic h5 {
    font-size: 16px;
  }

  .markdown-classic h6 {
    font-size: 16px;
  }

  .markdown-classic li {
    font-size: 16px;
  }

  .markdown-classic blockquote p {
    font-size: 16px;
  }

  .markdown-classic table tr th,
  .markdown-classic table tr td {
    font-size: 14px;
  }

  .markdown-classic table tr th {
    font-size: 16px;
  }

  .markdown-classic pre code {
    font-size: 14px;
  }

  .markdown-classic figcaption {
    font-size: 14px;
  }

  .markdown-classic .tag,
  .markdown-classic .m-tag2 {
    font-size: 14px;
  }

  .markdown-classic .footnotes {
    font-size: 16px;
  }

  .markdown-classic .footnote-item em {
    font-size: 16px;
  }

  .markdown-classic .footnote-item p em {
    font-size: 16px;
  }

  .markdown-classic .footnotes-sep::before {
    font-size: 22px;
  }
}